-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding the owner of an Weapon correctly #340
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I did this because some addons like Wiremod use CanTool for CPPI checks. But since we can't interact with our weapon, some functions stop working (like weapon core).
I'm not sure I understand the problem you're describing. What are weapon core functions and what does "stop working" entail specifically?
The problem is that the player doesn't own his weapon. We also get :DropWeapon() support to know who dropped it |
Why was this closed? |
I thought that this is not what should be added. |
Oh, I think I may have come across differently than I intended. Sorry about that. My questions were asking for clarification on what problem it solves exactly. You may indeed be right in that this is a good solution. So as I understand it now, the CPPIOwner is not set for carried weapons. I guess some addons don't realize that these entities are carried weapons (e.g. E2) , so instead of using |
Yes. That's what I'm trying to get across. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. I think in that case the solution looks good. I have just one small comment. Thanks for your patience!
We already do this for weapons created by toolgun, but not for those given out via Q-menu or other means. I did this because some addons like Wiremod use CanTool for CPPI checks. But since we can't interact with our weapon, some functions stop working (like weapon core).
It might be worth overwriting the weapon owner to always match :GetOwner(), but I'm not sure if that's what you want to do, so I copied the PlayerSpawnedSWEP behavior